Platform for users to upload and manage files. Built using Node.js and Next.js
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
-
Login / Register
-
Update Password
-
Delete Account
-
Account Information
-
Security Information
-
User location and session information
-
Docker
-
Responsive Fixes (It's still going on)
-
Swagger Documentation
-
Language Support (TR - EN)
-
Redis
POST /api/auth/register
Parameter | Type |
---|---|
userName , email password confirmPassword |
string |
POST /api/auth/login
Parameter | Type |
---|---|
email password confirmPassword |
string |
GET /api/auth/logout
Parameter | Type |
---|---|
no parameter needed |
string |
PUT /api/auth/updatePassword/:id
Parameter | Type |
---|---|
User ID |
string |
GET /api/user/getUserById/:id
Parameter | Type |
---|---|
User ID |
string |
GET /api/user/getUserLocationInformation
Parameter | Type |
---|---|
no parameter needed |
string |
GET /api/user/getUserOperatingSystemType
Parameter | Type |
---|---|
no parameter needed |
string |
DELETE /api/user/userAccountDeleted/:id
Parameter | Type |
---|---|
User ID |
string |
POST /api/upload/uploadFile
Parameter | Type |
---|---|
File type(.pdf.jpg) |
string |
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
To run tests, run the following command (Unit testing not yet completed)
npm run test
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)
})
})
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
This project is still under construction and will be added very soon
If you have any feedback, please reach out to me at [email protected]