Skip to content

aadeshkulkarni/figuringout

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Figuringout.Life

A Thought Journal App! This platform allows users to express themselves through journaling and engage with a community of fellow thinkers. Share your thoughts, ask intriguing questions, or drop a funny one-liner, and watch as your ideas resonate with others. The app is undergoing redesign, at the moment.
Explore the docs »

View App · Report Bug · Request Feature

About The Project

A NextJS frontend and Cloudflare workers backend application.

Features [TODO]:

  • Token based Authentication.
  • Create, Read, Update, Delete Posts.
  • Like, Comment, Repost Posts.
  • User profiles.
  • Subscribe profiles.

(back to top)

Technologies & Libraries

React Cloudflare Zod Typescript Prisma Postgres

(back to top)

Project Structure

  • Backend: Contains server-side code and logic.
  • Common: Shared assets and modules used by frontend and backend. (NPM Library)
  • Frontend-v2: Contains the latest code. (This is actively developed)
  • Frontend: Contains (legacy code) client-side code and logic. (This is deployed)

Local Setup

Backend

Pre-requisities:
  • Create a copy of .env.example and name the file .env
  • Set up Postgres DATABASE_URL in .env file. You can get a free PostgreSQL connection string from Aiven.io.
  • Create a copy of wrangler.sample.toml and name the file warngler.toml
  • Set up Prisma connection pool DATABASE_URL in wrangler.toml file. You can get this for free from Prisma.
  • Set up JWT Secret JWT_SECRET in wrangler.toml file. This can be any value.
  • Login to (cloudflare) and create a new R2 bucket. You probably need a Credit card for verfication.
  • Allow Access for R2.dev subdomain for your R2 bucket from R2>settings.
  • Replace Bucket-name and preview-your-bucket-name with your R2-bucket-name in wrangler.toml file.
  • Replace R2_SUBDOMAIN_URL with your R2 subdomain URL in wrangler.toml file.
cd backend
npm install
npm run prisma:migrate
npx prisma generate
npm run dev

Note: wrangler.toml is the environment configuration file for a serverless backend. .env is used by Prisma for connection pooling. Ensure you configure both environment files accordingly.

Frontend-v2

  • Navigate into the frontend directory using
cd frontend-v2
npm install
npm run dev

#### Frontend

- Navigate into the frontend directory using 
```bash

cd frontend
npm install
npm run dev

Note: frontend/src/config.ts contains BACKEND_URL. If you need your frontend to point to local backend server, uncomment export const BACKEND_URL = "http://localhost:8787".

Running Frontend and Backend Concurrently

To make the developer experience smoother, you can now run both the frontend and backend simultaneously using a single command from the project root.

Steps:
  • Ensure you have project root folder. install packages with
    npm install
  • Insall both frontend and backend pakages with
    npm install:all
  • Now you can simply run:
    npm run dev
    This command will start both the frontend and backend servers simultaneously.

For additional customization options and detailed information, please refer to the concurrently documentation.

Contributing

We welcome contributions from the community! To contribute, follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/[feature-title]).
  3. Make your changes and commit them (git commit -am 'Add brief meaningful commit message').
  4. Push to the branch (git push origin feature/[feature-title]).
  5. Create a new Pull Request.

For major changes, please open an issue first to discuss what you would like to change.

Read our contribution guidelines for more details.

🤝 Contributors

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Aadesh Kulkarni - [email protected]

Project Link: https://github.com/aadeshkulkarni/medium-app

Discord: https://discord.gg/JtTQkzFY89

(back to top)