A Full Stack Project which has Users and Posts. A user has 2 roles user
and admin
.
A user can have many posts. User can perform CRUD on its own posts. Admin can perform CRUD on all posts and all users.
Clone the project
git clone https://github.com/itxtalal/ikonic-test
Go to the project directory
cd ikonic-test
Run the Docker container in the background
docker compose up -d
Install dependencies
npm install -g concurrently
npm run install:all
npm run prisma:migrate
You can use prisma studio to view the PostgreSQL database and manipulate data directly (not recommended)
npm run prisma:studio
npm run dev
You can use your app by going to
http://localhost:5173/
By the way, Backend is hosted on this port
http://localhost:8000/
- If there are no users in the database, the first user created through the signup process will be assigned the role of an
admin
by default. - After signing up, you will be redirected to the home page where your user role will be displayed in the header.
- As an admin, you have the ability to perform various actions such as creating posts and users, updating posts and users, and deleting posts and users.
- You can view posts categorized as published, unpublished, or all posts in the database as an admin.
- As a regular user, you have limited privileges. You can create your own posts, edit and delete them, and update your profile by changing your email, password, and name.
To run tests, run the following command
npm run test
- Only End 2 End Testing is performed. For Backend only.
Client: React, Redux, Redux-Toolkit, Typescript, Vite, TailwindCSS, Axios
Server: Node, Express, Typescript, JWT, Brcypt, Jest, SuperTest
Database: PostgreSQL in a Docker Container