Coder Social home page Coder Social logo

boldurean / codu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codu-code/codu

0.0 0.0 0.0 22.52 MB

Codú's open-source codebase. A space for coders. Visit our community!

Home Page: https://codu.co/

License: Apache License 2.0

Shell 0.17% JavaScript 0.66% TypeScript 87.23% CSS 1.10% Dockerfile 0.19% MDX 10.65%

codu's Introduction

PRs Welcome

Codu Logo

A space for coders

Codú is the ultimate community of web developers to learn, share, and get support for your projects, either big or small. It is the perfect place to sharpen your skills and build your portfolio. In Codú, we're all here to help each other to grow as web developers. Plus, Codú makes it easier to find collaborators for your next big project.


💬 Join the conversation

We have a fantastic community growing on Discord. Click here to join!


🖥️ Installation

  1. Fork the project
  2. Clone with git clone https://github.com/YOUR_USERNAME/codu.git.
  3. Navigate to the project directory cd codu.
  4. Install dependencies with:
npm install
  • If you have any issues installing dependencies, check your node version against that defined in the .nvmrc. If you're using nvm, you can run nvm use before installing dependencies.
  1. Create a .env file and add the following variables. You can copy the contents of sample.env with cat sample.env > .env.
# This default value is if you run our local docker-compose.yml file to create the database.
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
# Setup your GitHub ID & Secret on GitHub: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps
# For development, make sure you set up this with a Homepage URL of http://localhost:3000/ and an Authorization callback URL of http://localhost:3000/api/auth
GITHUB_ID=YOUR_GITHUB_APP_ID
GITHUB_SECRET=YOUR_GITHUB_APP_SECRET
NEXTAUTH_URL=http://localhost:3000/api/auth

For a more detailed how to guide on setting them up go to the Environment Variables section.

  1. Make sure your database is running and setup the tables in the database with Drizzle by running:
npm run db:push
  1. Seed the database with some mock data by running:
npm run db:seed
  1. Finally, run the development server:
npm run dev

After completion of above commands, now -

Navigate to http://localhost:3000 in your browser to see the result.

You can start your journey by modifying pages/index.tsx. With Auto-update feature, pages updates as you edit the file.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn more about API routes here.

Environment Variables

DATABASE_URL

The DATABASE_URL is a connection string to a PostgreSQL database (version 15.0).

By default, we point to a database running locally with Docker from our docker-compose.yml file.

To run this file, make sure you have Docker installed and that Docker is running.

Run the command docker compose up.

Alternatively, if you have PostgreSQL running locally then you can use your local connection string or grab one from a free service like Supabase.

GITHUB_ID and GITHUB_SECRET

Currently, we only allow authentication via GitHub. To enable this you need to have a GITHUB_ID and GITHUB_SECRET value.

Setup your GitHub ID & Secret on GitHub:

Shortcut - Click here to setup New OAuth App.

For development, make sure you setup this with a Homepage URL of http://localhost:3000/ and Authorization callback URL of http://localhost:3000/api/auth.

Screenshot 2022-10-25 at 08 22 03

After you click the "Register application" button you should see the GITHUB_ID and be able to generate a new client secret. You can see this in the screenshot below. 👇 Screenshot 2022-10-25 at 08 23 22 After generating the secret, make sure you copy this value to your .env file as this value can not be seen again once you refresh the page. 👇 Screenshot 2022-10-25 at 08 26 04

Setting up Passwordless auth locally

In order to use Passwordless login locally you need to have a ACCESS_KEY and SECRET_KEY value.

Niall has written a tutorial on how to send emails with AWS SES and shows how to get these values.

Check out the example .env file here to see how to populate these values

Note: Currenly the AWS region of the SNS service is hardcoded to "eu-west-1" it may be necessary to change this if your SNS service is in a different region

NEXTAUTH_URL

You shouldn't need to change the default value here. This is a variable used by Next Auth as the authentication URL to your site.

NEXTAUTH_URL=http://localhost:3000/api/auth

For more information, you can read the documentation here. Example .env file can be found here. You can rename this to .env to get started

👨‍💻 Contribution Guidelines

  • Contributions are greatly appreciated. Contributions make the open-source community an amazing place to learn, inspire, and create.
  • Check out our contribution guidelines for contributiong to our repo. It includes
    • How to Contribute
    • How to create a Pull Request
    • Run Tests
    • Also, Style Guide for Commit Messages

📙 Prerequisite Skills to Contribute

📃 Documentation Contributions

💾 Code Contributions

📚 Additional Resources

To learn more about Next.js, take a look at the following resources:

Editor Doc

To learn about the editor shortcuts and hotkeys you can check out this document

💥 Issues

You are welcome to open issues to discuss ideas about improving our Codú. Enhancements are encouraged and appreciated.

codu's People

Contributors

nialljoemaher avatar johnallentech avatar john-paul-larkin avatar snyk-bot avatar xiaoniuniu89 avatar carolinacobo avatar darrachbarneveld avatar thanhsonng avatar sleithdylan avatar pkspyder007 avatar abhijeetgurle avatar maczi01 avatar brancualexandru avatar viniirbr avatar pateldivyesh1323 avatar jh3y avatar seog-jun avatar gdomaradzki avatar garyb1 avatar serzhan181 avatar shreyas-ram avatar realshaunoneill avatar rajugangitla avatar patrickhladun avatar lemondrop847 avatar danishkar avatar danboyce92 avatar dogpawhat avatar cbid2 avatar brianwhelandublin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.