Skip to content

TarikSogukpinar/upload-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Upload App

Platform for users to upload and manage files. Built using Node.js and Next.js

Screenshots

App Screenshot App Screenshot App Screenshot App Screenshot App Screenshot App Screenshot

Installation

git clone https://github.com/TarikSogukpinar/upload-app.git

Node.js

  cd server
  npm install
  npm run dev:production & npm run dev:development

Next.js

  cd client
  npm install
  npm run dev

Docker

  cd upload-app
  docker-compose up

Features

  • Login / Register

  • Update Password

  • Delete Account

  • Account Information

  • Security Information

  • User location and session information

  • Docker

  • Responsive Fixes (It's still going on)

Roadmap

  • Swagger Documentation

  • Language Support (TR - EN)

  • Redis

API Reference

Register User

  POST /api/auth/register
Parameter Type
userName, email password confirmPassword string

Login User

  POST /api/auth/login
Parameter Type
email password confirmPassword string

Logout User

  GET /api/auth/logout
Parameter Type
no parameter needed string

Update Password

  PUT /api/auth/updatePassword/:id
Parameter Type
User ID string

Get User By Id

  GET /api/user/getUserById/:id
Parameter Type
User ID string

Get User Location Information

  GET /api/user/getUserLocationInformation
Parameter Type
no parameter needed string

Get User Operating System Type

  GET /api/user/getUserOperatingSystemType
Parameter Type
no parameter needed string

User Account Deleted

  DELETE /api/user/userAccountDeleted/:id
Parameter Type
User ID string

Upload File

  POST /api/upload/uploadFile
Parameter Type
File type(.pdf.jpg) string

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

Node.js ENV

NODE_ENV = deveopment or production

PORT = 5000 or 4000

CLIENT_HOST = localhost:3000

PRIVATE_KEY = yoursecretkey

MONGO_URI = yourmongodbURL

Next.js ENV

SERVER_HOST = http://localhost:5000

Running Tests

To run tests, run the following command (Unit testing not yet completed)

  npm run test

Sample test methods

describe('Register', () => {
  it('should create a new user and return 200 status', async () => {
    const res = await request(app).post('/api/auth/register').send({
      firstName: 'exampleuserFirstName',
      lastName: 'exampleuserLastName',
      email: '[email protected]',
      password: 'testTarik123password',
      confirmPassword: 'testTarik123password',
    })

    expect(res.statusCode).toEqual(200)
  })
})

describe('Login', () => {
  it('should login user and return 200 status', async () => {
    const res = await request(app).post('/api/auth/login').send({
      email: '[email protected]',
      password: 'Tarik123',
    })

    expect(res.statusCode).toEqual(200)
  })
})

Tech Stack

Client: Next.js, Tailwind CSS

(Packages: axios, jose, jwt-decode, tailwindcss, react-hot-toast)

Server: Node.js, Express.js

(Packages: express, bcryptjs, compression, cookie-parser, jsonwebtoken, dotenv, cors, geoip-lite, helmet, joi, joi-password-complexity, mongoose, moment, multer, nodemailer, slugify, uuid, xss-clean, express-mongo-sanitize, express-rate-limit, jest, nodemon, supertest, cross-env, ipify, http-status-codes)

Database: Mongo DB

Demo

This project is still under construction and will be added very soon

Feedback

If you have any feedback, please reach out to me at [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages