Skip to content

Instantly share code, notes, and snippets.

View HabeebCycle's full-sized avatar

Habeeb Okunade HabeebCycle

View GitHub Profile
package com.habeebcycle.demo.api.repository;
import com.habeebcycle.demo.api.model.User;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import reactor.core.publisher.Mono;
public interface UserRepository extends ReactiveCrudRepository<User, String> {
Mono<User> findByUsername(String username);
Mono<User> findByEmail(String name);
Mono<Boolean> existsByUsername(String username);
package com.habeebcycle.demo.api.persistence;
import com.habeebcycle.demo.api.model.User;
import com.habeebcycle.demo.api.repository.UserRepository;
import org.reactivestreams.Publisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.data.redis.core.ReactiveHashOperations;
import org.springframework.data.redis.core.ReactiveRedisOperations;
package com.habeebcycle.demo.api.controller;
import com.habeebcycle.demo.api.model.User;
import com.habeebcycle.demo.api.service.UserService;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@RestController
@RequestMapping("/user")
package com.habeebcycle.demo.api.service;
import com.habeebcycle.demo.api.persistence.UserRepoImpl;
import com.habeebcycle.demo.api.model.User;
import com.habeebcycle.demo.api.repository.UserRepository;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@Service
package com.habeebcycle.demo.api.persistence;
import com.habeebcycle.demo.api.model.User;
import com.habeebcycle.demo.api.persistence.UserRepoImpl;
import com.habeebcycle.demo.api.repository.UserRepository;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.redis.DataRedisTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.dao.DuplicateKeyException;
package com.habeebcycle.demo.api;
import com.habeebcycle.demo.api.model.User;
import com.habeebcycle.demo.api.service.UserService;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.test.web.reactive.server.WebTestClient;
@HabeebCycle
HabeebCycle / mern-server-setup.md
Last active November 26, 2022 12:27 — forked from bradtraversy/mern-server-setup.md
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

https://www.youtube.com/watch?v=7aRjGIhwyQM

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)