Check out the live demo of the app: Medium Blogging App
Test Credentials -
Email - test@testemail.com
Password - Test@1234
- React in the frontend
- Cloudflare workers in the backend
- zod as the validation library, type inference for the frontend types
- Typescript as the language
- Prisma as the ORM, with connection pooling
- Postgres as the database
- jwt for authentication
For the db, I've used Postgres and prisma for ORM and connection pool, and since I wanted it to deploy to cloudflare workers as it serverless, also cloudflare has its own js runtime, but it supports Hono
and not Nodejs
so for routing and stuff i have used Hono
instead of express
or other library which is dependent on Nodejs
It generally contains the types
which is used by both frontend and backend since, writing it on both places would have been violation of DRY rule, so i created a commons folder and wrote the types and the zod validation schema and published it to npmjs as a public package and used it in both frontend and backend,
Here is the link to that package
To avoid all that mumbo-jumbo a better solution would have been Monorepo.
A simple React project
-
In the
.env
file enter the url of your actual postgreSQL DB -> it the the link through where prisma picks the db link from while running locally -
In the
wrangler.toml
file enter theJWT_SECRET
and theDATABASE_URL
-> Connection Pool url its where the application picks the db link from while deployed
npm i
npm run dev
- In the
.env
enter the url of the backend the run
npm i
npm run dev
Contributions are welcome! If you have suggestions for new features, bug fixes, or improvements, please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or suggestions, please feel free to contact.