This is a fullstack real estate app, built with Go version 1.19 and NextJs
safe_haven.mp4
This project is a simple real estate app project which aims to connect people with properties directly. It has some key features like;
- Authentication
- Agents create, update and delete their properties
- Agents verification
- admin dashboard (Coming Soon)
- Create and manage properties
- Showcase the properties
- Notifification system
Postgres
- Alex Edwards SCS - For managing sessions
- Chi router - For create routes
- Justinas nosurf - Cross-Site Request Forgery
- JackC PGX - PGX is a pure Go driver and toolkit for PostgreSQL.
- SendinBlue Used for sending mails.
- Go JWT - For JWT authentications.
- TypeScript - For type checking
- React Redux - For state management
- Tailwind CSS - For styling
- HeadlessUI - Tailwind CSS Plugin
- Tailwind CSS - Tailwind CSS Plugin
- React Lexical - Rich text editor
- React hook form and zod - Forms and form validations
- Cloudinary React - To store images
- Framer Motion - For animations
- React Showdown - For reading markdown
- Swiper js - For sliders
- Create your own go mod file and delete the one used here, run the following command
go mod init your-project-name
- your-project-name is usually your github link and the name of your project, example "github.com/prosper74/go-project". This is not a must, but a recommendation.
- Change the name of every import to your current go mod name. Example, open the main.go file, in the
required imports
section, replace these "github.com/atuprosper/go-project/pkg/config" to "github.com/atuprosper/your-project-name/pkg/config". Go through all files and make this replacement - After all the necessary changes, run the app
go run cmd/web/*.go
this will install all the third party packages and run the server on the selected port. - Create your postgres db
- Setup the flags in main.go file -
cmd/web/main.go
- Setup the flags in run.sh file
- Do not use the rub.bat file as it encounters errors sometimes from windows. run.sh will work for both windows and linux
- Setup the .env file, rename the
.env.example
to.env
. Create your sendinBlue account and add the api - In the .env file, the
POSTGRES_URI
is the hosted database, while the other database strings are for localhost. After setting either one up, make sure to check themain.go
file - Setup the
database.yml
, rename thedatabase.yml.example
todatabase.yml
. This will enable you to runsoda migrate
-
Manually:
go run cmd/web/main.go cmd/web/middleware.go cmd/web/routes.go cmd/web/sendMail.go
-
Batch (Please use the linux method even on windows, as it works pretty well):
On Windows - create arun.bat
file in the root directory of the project and paste the below codego build -o out cmd/web/*.go ./out.exe
Then run
run.bat
in the terminalOn linux - create a
run.sh
file in the root directory of the project and paste the below code#!/bin/bash go build -o out cmd/web/*.go ./out <pass your flag dependencies here>
Run
chmod +x run.sh
then run./run.sh
in the terminal
- install
soda
, rungo install github.com/gobuffalo/pop/v6/soda@latest
soda g config
to generate a database.yml file in the current directory for a PostgreSQL database. Then setup your database- run
soda generate fizz migration-name
in the terminal, to create the migration folder and files. Run this code to create migration files for each table - We can also run sql version
soda generate sql migration-name
- The up file is used to create or update while the down file is used to delete or downgrade
- run
soda migrate
to run the migration files - run
soda migrate down
to run the down migration files - run
soda reset
to drop everything in the database and create the migration again - Read the documentation to know more about Buffalo or the Fizz Github page